home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / cvs / sprite / cvs.h < prev    next >
C/C++ Source or Header  |  1991-08-20  |  5KB  |  171 lines

  1. /*    $Id: cvs.h,v 1.3 91/08/20 12:58:34 jhh Exp $    */
  2.  
  3. #include <strings.h>
  4. #include <string.h>
  5. #include <stdio.h>
  6. #ifdef sprite
  7. #include <sys/dir.h>
  8. #endif
  9. /*
  10.  *    Copyright (c) 1989, Brian Berliner
  11.  *
  12.  *    You may distribute under the terms of the GNU General Public License
  13.  *    as specified in the README file that comes with the CVS 1.0 kit.
  14.  *
  15.  * Definitions for the CVS Administrative directory and
  16.  * the files it contains.  Here as #define's to make changing
  17.  * the names a simple task.
  18.  */
  19. #define    CVSADM        "CVS.adm"
  20. #define    CVSADM_ENT    "CVS.adm/Entries"
  21. #define    CVSADM_ENTBAK    "CVS.adm/Entries.Backup"
  22. #define    CVSADM_ENTSTAT    "CVS.adm/Entries.Static"
  23. #define    CVSADM_FILE    "CVS.adm/Files"
  24. #define    CVSADM_MOD    "CVS.adm/Mod"
  25. #define    CVSADM_REP    "CVS.adm/Repository"
  26. #define    CVSADM_CIPROG    "CVS.adm/Checkin.prog"
  27.  
  28. /*
  29.  * Definitions for the CVSROOT Administrative directory and
  30.  * the files it contains.  This directory is created as a
  31.  * sub-directory of the $CVSROOT environment variable, and holds
  32.  * global administration information for the entire source
  33.  * repository beginning at $CVSROOT.
  34.  */
  35. #define    CVSROOTADM        "CVSROOT.adm"
  36. #define    CVSROOTADM_MODULES    "CVSROOT.adm/modules"
  37. #define    CVSROOTADM_LOGINFO    "CVSROOT.adm/loginfo"
  38.  
  39. /* support for the CVSROOTADM files */
  40. #define    CVSMODULE_FILE    "modules" /* last component of CVSROOTADM_MODULES */
  41. #define    CVSMODULE_TMP    ".#modules.XXXXXX"
  42. #define    CVSMODULE_OPTS    "ai:o:t:"
  43. #define    CVSLOGINFO_FILE    "loginfo" /* last component of CVSROOTADM_LOGINFO */
  44. #define    CVSLOGINFO_TMP    ".#loginfo.XXXXXX"
  45.  
  46. /* Other CVS file names */
  47. #define    CVSATTIC    "Attic"
  48. #define    CVSLCK        "#cvs.lock"
  49. #define    CVSTFL        "#cvs.tfl"
  50. #define    CVSRFL        "#cvs.rfl"
  51. #define    CVSWFL        "#cvs.wfl"
  52. #define    CVSEXT_OPT    ",p"
  53. #define    CVSEXT_LOG    ",t"
  54. #define    CVSPREFIX    ",,"
  55. #define    CVSTEMP        "/tmp/cvslog.XXXXXX"
  56.  
  57. /* miscellaneous CVS defines */
  58. #define    CVSEDITPREFIX    "CVS: "
  59. #define    CVSLCKAGE    600        /* 10-min old lock files cleaned up */
  60. #define    CVSLCKSLEEP    15        /* wait 15 seconds before retrying */
  61. #define    DFLT_RECORD    "/dev/null"
  62. #define    BAKPREFIX    ".#"        /* when rcsmerge'ing */
  63. #define    DEVNULL        "/dev/null"
  64.  
  65. #define    FALSE        0
  66. #define    TRUE        1
  67.  
  68. /*
  69.  * Definitions for the RCS file names.
  70.  */
  71. #define    RCS        "rcs"
  72. #define    RCS_CI        "ci"
  73. #define    RCS_CO        "co"
  74. #define    RCS_RLOG    "rlog"
  75. #define    RCS_DIFF    "rcsdiff"
  76. #define    RCS_MERGE    "rcsmerge"
  77. #define    RCS_MERGE_PAT    "^>>>>>>> "    /* runs "grep" with this pattern */
  78. #define    RCSID_PAT    "\"\\(\\$Id.*\\)\\|\\(\\$Header.*\\)\"" /* when committing files */
  79. #define    RCSEXT        ",v"
  80. #define    RCSHEAD        "head"
  81. #define    RCSBRANCH    "branch"
  82. #define    RCSSYMBOL    "symbols"
  83. #define    RCSDATE        "date"
  84. #define    RCSDESC        "desc"        /* ends the search for branches */
  85. #define    DATEFORM    "%02d.%02d.%02d.%02d.%02d.%02d"
  86.  
  87. /* Programs that cvs runs */
  88. #define    DIFF        "/bin/diff"
  89. #define    GREP        "/bin/grep"
  90. #define    RM        "/bin/rm"
  91. #define    SORT        "/usr/bin/sort"
  92.  
  93. /*
  94.  * Environment variable used by CVS
  95.  */
  96. #define    CVSREAD_ENV    "CVSREAD"    /* make files read-only */
  97. #define    CVSREAD_DFLT    FALSE        /* writable files by default */
  98.  
  99. #define    RCSBIN_ENV    "RCSBIN"    /* RCS binary directory */
  100. #define    RCSBIN_DFLT    "/sprite/cmds" /* directory to find RCS progs */
  101.  
  102. #define    EDITOR_ENV    "EDITOR"    /* which editor to use */
  103. #define    EDITOR_DFLT    "/sprite/cmds/vi"    /* somewhat standard */
  104.  
  105. #define    CVSROOT_ENV    "CVSROOT"    /* source directory root */
  106. #define    CVSROOT_DFLT    NULL        /* No dflt; must set for checkout */
  107.  
  108. /*
  109.  * If the beginning of the Repository matches the following string,
  110.  * strip it so that the output to the logfile does not contain a full pathname.
  111.  *
  112.  * If the CVSROOT environment variable is set, it overrides this define.
  113.  */
  114. #define    REPOS_STRIP    "/src/master/"
  115.  
  116. /*
  117.  * The maximum number of files per each CVS directory.
  118.  * This is mainly for sizing arrays statically rather than
  119.  * dynamically.  3000 seems plenty for now.
  120.  */
  121. #define    MAXFILEPERDIR    3000
  122. #define    MAXLINELEN    1000        /* max input line from a file */
  123. #define    MAXPROGLEN    30000        /* max program length to system() */
  124. #define    MAXLISTLEN    20000        /* For [A-Z]list holders */
  125. #define    MAXMESGLEN    1000        /* max RCS log message size */
  126.  
  127. /*
  128.  * The type of request that is being done in do_module() &&
  129.  * the type of request that is being done in Find_Names().
  130.  */
  131. enum mtype { CHECKOUT, TAG, PATCH };
  132. enum ftype { ALL, ALLPLUSATTIC, MOD };
  133.  
  134. extern char *progname, *command;
  135. extern char Clist[], Glist[], Mlist[], Olist[], Dlist[];
  136. extern char Alist[], Rlist[], Wlist[], Llist[], Blist[];
  137. extern char User[], Repository[], SRepository[], Rcs[];
  138. extern char VN_User[], VN_Rcs[], TS_User[], TS_Rcs[];
  139. extern char Options[], Tag[], Date[], prog[];
  140. extern char *Rcsbin, *Editor, *CVSroot;
  141. extern int really_quiet, quiet;
  142. extern int use_editor;
  143. extern int cvswrite;
  144. extern int force_tag_match;
  145.  
  146. extern int fileargc;            /* for Find_Names() */
  147. extern char *fileargv[];
  148.  
  149. /*
  150.  * Externs that are included directly in the CVS sources
  151.  */
  152. extern FILE *open_file();
  153. extern char *xmalloc();
  154. extern int ppstrcmp();
  155. extern int ppstrcmp_files();
  156. extern void Lock_Cleanup();
  157.  
  158. /*
  159.  * Externs that are included in libc, but are used frequently
  160.  * enough to warrant defining here.
  161.  */
  162. extern char *sprintf();
  163. extern char *optarg;            /* for getopt() support */
  164. extern char *getwd();
  165. extern char *re_comp();
  166. extern int optind;
  167.  
  168. #ifdef sprite
  169. #define dirent direct
  170. #endif
  171.